#pragma once

#include <pthread.h>

class Spinlock
{
public:
	Spinlock();
	virtual ~Spinlock();

	int Lock();
	int Unlock();
	int TryLock();
	pthread_spinlock_t* Get() { return &_spinlock; }

private:
	pthread_spinlock_t _spinlock;
};